import path from 'node:path'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    lib: {
      entry: [path.resolve(__dirname, 'src/background/service-worker.ts')],
      formats: ['cjs'],
      fileName: () => {
        return 'background.js'
      },
    },
    outDir: 'dist/background',
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
    },
  },
  plugins: [vue()],
})
